import request from "@/service/request";

// 获取未审核任务列表
const getUnCheckList = (query: any) => {
  return request({
    url: "/system/examineTask/todoList",
    method: "get",
    params: query,
  });
};

// 获取审核任务列表
const getCheckedList = (query: any) => {
  return request({
    url: "/system/examineTask/list",
    method: "get",
    params: query,
  });
};

// 获取政治审核
const getPoliticsPoolList = (query: any) => {
  return request({
    url: "/system/examineTask/empty",
    method: "get",
    params: query,
  });
}

// 获取年龄列表
const getAgeList = (query: any) => {
  return request({
    url: "/course/age/page",
    method: "get",
    params: query,
  });
};

// 获取课程详情
const getCourseDetail = (id: string) => {
  return request({
    url: "/course/course/" + id,
    method: "get",
  });
};

// 获取审核池列表
const getCheckPoolList = (query: any) => {
  return request({
    url: "/system/examineTask/empty",
    method: "get",
    params: query,
  });
};

// 占有审核任务
const preemptCheckTask = (id: string) => {
  return request({
    url: "/course/course/grab/" + id,
    method: "post",
  });
};

// 获取审核任务详情
const getCheckTaskDetail = (id: string) => {
  return request({
    url: "/system/examineTask/" + id,
    method: "get",
  });
};
// 获取场景分类列表
const getSceneList = () => {
  return request({
    url: "/course/scene/list",
    method: "get",
  });
};

// 获取章节列表
const getChapterList = (query: any) => {
  return request({
    url: "/course/section/list",
    method: "get",
    params: query,
  });
};

// 获取播放凭证
const getPlayAuth = (id: string) => {
  return request({
    url: "/course/resource/play/" + id,
    method: "get",
  });
};

// 获取一级分类
const getFirstCatgroyList = (id: string) => {
  return request({
    url: "/course/category/listByScene/" + id,
    method: "get",
  });
};

// 团队管理员通过审核
const teamManagerPass = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
};

// 团队管理员拒绝
const teamManagerRefuse = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
};

// 学校管理员审核通过
const schoolManagerPass = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
};

// 学校管理员拒绝
const schoolManagerRefuse = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
};

// 校长通过并发布子站
const headmasterPass = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
};

// 校长通过并提交平台
const publishAndSubmit = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
}

// 校长拒绝
const headmasterRefuse = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
}

// 政治专家审核通过
const politicsExpertPass = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
};

// 政治专家审核拒绝
const politicsExpertRefuse = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
}

// 运营人员通过
const operationPeoplePass = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
}

// 修改课程详情
const  setCore = (query: any) => {
  return request({
    url: `/course/course/edit`,
    method: "put",
    data: query
  });
}

// 获取课程详情
const getCourseInfo = (id: string) => {
  return request({
    url: `/course/course/`+id,
    method: "get",
  });
}

//运营拒绝
const operationPeopleRefuse = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
}

// 内容专家通过
const contentExpertPass = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
}


// 内容专家审核拒绝
const contentExpertRefuse = (query: any) => {
  return request({
    url: "/system/examineTask/examine",
    method: "put",
    data: query,
  });
}

// 抢政治审核任务
const grabTask = (id: string) => {
  return request({
    url: "/course/course/grab/"+ id,
    method: "post",
  });
}

// 获取内容审核列表
const getContentPoolList = (query: any) => {
  return request({
    url: "/system/examineTask/empty",
    method: "get",
    params: query,
  });
}

// 获取年级列表
const getGradelist = () => {
  return request({
    url: "/course/grade/list",
    method: "get",
  });
}

// 设置核心课程的年级
const handelSettingGrade = (query: any) => {
  return request({
    url: "/course/grade/courseGrade",
    method: "post",
    data: query
  });
} 

// 修改核心课程年级
const handelChangeGrade = (query: any) => {
  return request({
    url: "/course/grade/courseGrade",
    method: "put",
    data: query
  });
}

// 设置核心课程的年级
const handelSettingCore = (query: any) => {
  return request({
    url: "/course/course/edit",
    method: "put",
    data: query
  });
} 

// 获取审核记录
const getCheckRecord = (query: any) => {
  return request({
    url: "/system/examineTask/list",
    method: "get",
    params: query
  });
}

// 保存审核任务
const checkTaskSave = (query: any) => {
  return request({
    url: "/system/examineTask/save",
    method: "post",
    data: query
  });
}

/**
 * 获取所有标签
 * @param query
 */
const getCapacityLabelList = (query: any) => {
  return request({
    url: "/course/label/list",
    method: "get",
    params: query,
  });
};

export {
  getUnCheckList,
  getAgeList,
  getCourseDetail,
  getSceneList,
  getChapterList,
  getPlayAuth,
  getFirstCatgroyList,
  teamManagerPass,
  getCheckPoolList,
  preemptCheckTask,
  getCheckTaskDetail,
  getCheckedList,
  teamManagerRefuse,
  schoolManagerPass,
  headmasterPass,
  schoolManagerRefuse,
  publishAndSubmit,
  headmasterRefuse,
  getPoliticsPoolList,
  politicsExpertPass,
  grabTask,
  getContentPoolList,
  contentExpertPass,
  politicsExpertRefuse,
  contentExpertRefuse,
  operationPeoplePass,
  operationPeopleRefuse,
  getGradelist,
  handelSettingGrade,
  handelSettingCore,
  setCore,
  getCourseInfo,
  handelChangeGrade,
  getCheckRecord,
  checkTaskSave,
  getCapacityLabelList
};
